package com.seven.sevenchat.service;

import com.seven.sevenchat.VO.TeamUserVO;
import com.seven.sevenchat.model.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.seven.sevenchat.model.User;
import com.seven.sevenchat.model.dto.TeamQuery;
import com.seven.sevenchat.model.request.TeamJoinRequest;
import com.seven.sevenchat.model.request.TeamQuitRequest;
import com.seven.sevenchat.model.request.TeamUpdateRequest;

import java.util.List;

/**
* @author Dell
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2025-01-26 00:16:15
*/
public interface TeamService extends IService<Team> {

    /**
     * 添加队伍
     * @param team
     * @param loginUser
     * @return
     */
    long addTeam(Team team, User loginUser);

    /**
     * 搜索队伍
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery, boolean isAdmin);

    /**
     * 修改队伍
     * @param team
     * @param logininUser
     * @return
     */
    boolean updateTeam(TeamUpdateRequest team, User logininUser);

    /**
     * 加入队伍
     * @param team
     * @param joinUser
     * @return
     */
    boolean joinTeam(TeamJoinRequest team, User joinUser);

    /**
     * 退出队伍
     * @param team
     * @param joinUser
     * @return
     */
    boolean quitTeam(TeamQuitRequest team, User joinUser);

    /**
     * 删除队伍
     * @param id
     * @param loginUser
     * @return
     */
    boolean deleteTeam(long id, User loginUser);
}
